Repository navigation
feat(anr): [Non-Fatal ANR 7] Sample app and UI test for non-fatal ANRs - #6728
Conversation
PR risk: mediumFor commit The model rated this change low. It was raised to medium because:
This label is a hint for reviewers, not an approval. |
Instructions and example for changelogPlease add an entry to Example: ## Unreleased
### Features
- [Non-Fatal ANR 7] Sample app and UI test for non-fatal ANRs ([#6728](https://github.com/getsentry/sentry-java/pull/6728))If none of the above apply, you can opt out of this check by adding |
📲 Install BuildsAndroid
|
8f190b0 to
72aa113
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 72aa113. Configure here.
| assertTrue(durationMs.toLong() >= 700, "duration_ms: $durationMs") | ||
| } | ||
| assertNoOtherEnvelopes() | ||
| } |
There was a problem hiding this comment.
UI test flakes on extra ANR envelopes
Medium Severity
blockingMainThreadSendsOneNonFatalAnrEvent increments the relay idling resource once and requires exactly one envelope after launching EmptyActivity and sleeping 2s on the main thread. Hang detection starts at onStart and can already report a non-fatal ANR if AppCompat startup blocks the main thread for the 700 ms threshold, then the sleep sends a second event. waitUntilIdle can return after the first envelope, so assertNoOtherEnvelopes races and the extra decrement can corrupt CountingIdlingResource.
Triggered by project rule: PR Review Guidelines for Cursor Bugbot
Reviewed by Cursor Bugbot for commit 72aa113. Configure here.


Adds sample app buttons and a UI test for non-fatal ANRs, and the CHANGELOG entry.
Design: Non-Fatal ANR Architecture (JAVA-777)
🤖 Generated with Claude Code